package com.gbb.simple;

import android.app.Application;

import com.gbb.common.AppUtils;
import com.yanzhenjie.nohttp.InitializationConfig;
import com.yanzhenjie.nohttp.NoHttp;
import com.yanzhenjie.nohttp.OkHttpNetworkExecutor;

/**
 * @author gaobingbing91 on 2016/7/17.
 */
public class FrameApplication extends Application {

    @Override
    public void onCreate() {
        super.onCreate();
        AppUtils.inject(this);
        initHttp();
        // 删除之前的log,只记录应用本次操作的log
        // FileUtils.deleteFolderFile(LogUtil.logPath);

        // 异常崩溃处理，写入log文件
//        GlobalExceptionHandler.getInstance().init(this);
    }

    public static void initHttp() {
        InitializationConfig.Builder builder = InitializationConfig.newBuilder(AppUtils.get());
        builder.networkExecutor(new OkHttpNetworkExecutor());
        NoHttp.initialize(builder.build());
    }

}
